﻿<Window x:Class="BaMusaSoft.RPS.View.AddOutboxWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:wpfExtended="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
		Title="AddOutboxWindow" FlowDirection="RightToLeft" WindowStyle="ToolWindow" SizeToContent="WidthAndHeight" 
		WindowStartupLocation="CenterOwner" Loaded="WindowLoaded" ResizeMode="NoResize" FontFamily="Simplified Arabic" FontSize="16">
	<Window.Resources>
		
		<Storyboard x:Key="GotFocus">
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="border">
				<EasingColorKeyFrame KeyTime="0" Value="#FFDBEBFF"/>
			</ColorAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="LostFocus">
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="border">
				<EasingColorKeyFrame KeyTime="0" Value="#FFF0F0F0"/>
			</ColorAnimationUsingKeyFrames>
			
		</Storyboard>
		
	</Window.Resources>
	<Window.Triggers>
		<EventTrigger RoutedEvent="Keyboard.GotKeyboardFocus" SourceName="txtOutboxNo">
			<BeginStoryboard Storyboard="{StaticResource GotFocus}"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="Keyboard.LostKeyboardFocus" SourceName="txtOutboxNo">
			<BeginStoryboard x:Name="LostFocus_BeginStoryboard" Storyboard="{StaticResource LostFocus}"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="Keyboard.GotKeyboardFocus" SourceName="txtOutobDate">
			<BeginStoryboard Storyboard="{StaticResource GotFocus}"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="Keyboard.LostKeyboardFocus" SourceName="txtOutobDate">
			<BeginStoryboard x:Name="LostFocus_BeginStoryboard1" Storyboard="{StaticResource LostFocus}"/>
		</EventTrigger>
	</Window.Triggers>
	<Grid UIElement.PreviewKeyDown="Grid_KeyDown">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<Border x:Name="border" Grid.Row="0" BorderThickness="1" Margin="10" Padding="10" BorderBrush="#FF71A5C4">
			<Border.Background>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="White" Offset="0"/>
					<GradientStop Color="White" Offset="1"/>
				</LinearGradientBrush>
			</Border.Background>
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition/>
					<RowDefinition/>
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition/>
					<ColumnDefinition/>
				</Grid.ColumnDefinitions>
		<TextBlock Grid.Row="0" Grid.Column="0" Height="23" HorizontalAlignment="Left" Margin="8" Name="textBlock1" Text="رقم الصادر" VerticalAlignment="Top" />
		<wpfExtended:MaskedTextBox Grid.Row="0" Grid.Column="1" Height="30" x:Name="txtOutboxNo" IncludeLiterals="False" Mask="####/ #### /ج" ToolTip="أدخل الرقم كالتالي:1432/0001/ج"
								   HorizontalAlignment="Left" Margin="8" VerticalAlignment="Top" Width="250"
								   Value="{Binding Path=OutboxNo, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource OutboxConverter}}" TabIndex="0"/>
		<TextBlock Grid.Row="1" Grid.Column="0" Height="23" HorizontalAlignment="Left" Margin="8" Name="textBlock2" Text="تاريخ الصادر" VerticalAlignment="Top" />
		<wpfExtended:MaskedTextBox Grid.Column="1" Grid.Row="1" x:Name="txtOutobDate" Height="30" IncludeLiterals="False" Mask="##/ ## / ####"  HorizontalAlignment="Left" Margin="8" VerticalAlignment="Top" Width="250" 
				 Value="{Binding Path= OutboxDate, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource DateConverter}}" TabIndex="1"/>
			</Grid>
		</Border>
		<CheckBox Content=" ترقيم تلقائي من هذا الرقم" Grid.Row="1" HorizontalAlignment="Left" Name="checkBox1" VerticalAlignment="Top" 
				  IsChecked="{Binding Path=AutoIncrementOutboxNo, UpdateSourceTrigger=PropertyChanged}" IsThreeState="False" Margin="8" TabIndex="2" BorderThickness="1"/>
		<Rectangle Grid.Row="2" Height="2" StrokeThickness="2" Stretch="Fill" Stroke="#FFC8C7C7"/>
		<StackPanel Grid.Row="3" Orientation="Horizontal" Background="#FFF0F0F0">
		<Button Content="حفظ" Grid.Column="1" Grid.Row="3" Height="30" HorizontalAlignment="Left" Margin="8,5,8,8" 
				x:Name="btnSave" VerticalAlignment="Top" Width="75" Command="{Binding SaveCommand}" TabIndex="3" />
			<Button Content="إضافة" Grid.Column="1" Grid.Row="3" Height="30" HorizontalAlignment="Left" Margin="8,5,8,8" x:Name="btnAdd" VerticalAlignment="Top" Width="75" Click="button1_Click" TabIndex="4" IsDefault="True" 
					IsEnabled="{Binding OutboxSaved}"/>
			</StackPanel>
	</Grid>
</Window>
